home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 17448 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  2.9 KB

  1. Path: news.cyberport.com!usenet
  2. From: tangent@cyberport.com (Warren Young)
  3. Newsgroups: comp.lang.c++,rec.games.programmer,alt.msdos.programmer,comp.programming
  4. Subject: Re: Young programmers read me.
  5. Date: Mon, 15 Apr 1996 22:37:41 GMT
  6. Organization: none
  7. Message-ID: <3172cdaa.443346438@news.cyberport.com>
  8. References: <4icpp9$7hr@barad-dur.nas.com> <4imqe4$cj3@ping1.ping.be> <1996Mar23.224853.116513@kuhub.cc.ukans.edu> <4j52hn$ikb@news.ios.com> <Pine.OSF.3.91.960403112207.17337H-100000@bud.cc.swin.edu.au> <aidan-0404961557290001@meathook.intac.com> <pnoguchi-0404962135210001@pnoguchi.his.com> <aidan-0604961847480001@meathook.intac.com> <316a2987.3677177@news.cyberport.com> <316C722E.528A@his.com>
  9. NNTP-Posting-Host: ppp15.cyberport.com
  10. X-Newsreader: Forte Agent .99d/32.182
  11.  
  12. Tom Daniels <tdaniels@his.com> wrote:
  13.  
  14. >> such.  Could you, for example, assign a raw address to the Oberon
  15. >> sample?  You can in C/C++, because they're directly analogous to the
  16. >> underlying machine structures.
  17. >
  18. >My question is this:  If you are writing non system type programs
  19. >(I include games in this category), why in the world would you
  20. >ever resort to such a hack as to assign a raw address to a function
  21. >pointer.  It's that sort of crap (that is easy to do even by 
  22. >accident) that C is infamous for.  As a program manager heading a
  23. >project, I would shoot at dawn, the first programmer who pulled this
  24. >kind of crap.  If you gotta do that stuff, you've misdesigned
  25. >your program structure somewhere.
  26.  
  27. You're right, the only sane time to do something like this is when
  28. you're using C to get at hardware structures.  I used to use it all
  29. the time to get at BIOS and video stuff, because there really was no
  30. other way to do it.  Plus, if all this is hidden away in a library
  31. somewhere, it doesn't much impact the maintainability of the program.
  32. After all, such low-level libraries rarely change, if done right.
  33.  
  34. Now if you're using it to do calculated jumps into the middle of your
  35. code, yes, string `em up by their small toes and jerk on the cord
  36. until they break off.  Repeat until no toes left.  Then give them an
  37. assembler, which is what they really wanted in the first place.
  38.  
  39. Okay, so now let's say you're not doing anything that needs low-level
  40. hardware access.  Does that mean C is a bad choice?  Well, maybe, but
  41. not for that reason.  You simply don't use the tool.  
  42.  
  43. I just did a small computer repair job today -- I brought along my
  44. suitcase-sized toolkit, but only used some gender menders, a
  45. screwdriver and a nutdriver.  Does that mean my toolkit is bad because
  46. it has a lot of stuff that was completely useless to me on this job?
  47. No, I just ignored the tools I didn't need just then.  Among them was
  48. an X-Acto knife, a very dangerous tool to be using around computers.
  49. Is the toolkit too dangerous to use?  No, because I wasn't using that
  50. tool, and if I was, I would use due caution.
  51.  
  52. Sure, the analogy isn't perfect, but I think it makes the point.
  53.  
  54. = Warren --
  55.